var gulp=require("gulp"),
concat=require("gulp-concat"),
mincss=require("gulp-minify-css"),
minjs=require("gulp-uglify"),
rename=require("gulp-rename"),
jshint=require("gulp-jshint"),
connect=require("gulp-connect"),
less=require("gulp-less");
gulp.task('js',function(){
	gulp.src('js/*.js')
    .pipe(concat('max.js'))
    .pipe(minjs())
    .pipe(rename({suffix:'.hd'}))
    .pipe(connect.reload())
    .pipe(gulp.dest('js1'))
});
gulp.task('css',function(){
	gulp.src('css/*.css')
    .pipe(concat('max.css'))
    .pipe(mincss)
    .pipe(rename({suffix:'.hd'}))
    .pipe(connect.reload())
    .pipe(gulp.dest('css1'))
});
gulp.task('less',function(){
	gulp.src('less/*.less')
   .pipe(less())
    .pipe(gulp.dest('css'))
});
gulp.task('html',function(){
	gulp.src('html/*.html')
    .pipe(connect.reload())
});
gulp.task('jshint',function(){
	gulp.src('js/*.js')
    .pipe(jshint())
    .pipe(jshint.reporter('default'));
});
gulp.task('watch',function(){
   gulp.watch('css/*.css',['css']);
   gulp.watch('less/*.less',['less']);
   gulp.watch('html/*.html',['html']);
   gulp.watch('js/*.js/',['js']);
});